<template>
  <div>
    <h1>这是组件c</h1>
    <h3>拿到home页面的数据是{{ $attrs.msg }}</h3>
    <button @click="handler">想要调用爷爷的方法</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg: "这是孙子组件的msg 想传给爷爷组件",
    };
  },
  methods: {
    handler() {
      this.$emit("handler", this.msg);
    },
  },
  created() {},
  mounted() {},
  components: {},
  computed: {},
  watch: {},
};
</script>

<style lang="scss" scoped></style>
